import re


def fun(temp):
    ret = temp.group()
    l = []
    for s in ret:
        l.append(s)

    l.reverse()
    str = ''
    for s in l:
        str += s

    return str

# str1 = 'abc-1de/fg'
str1 = 'op123aasxcd/-1w12=sdeer'
ret = re.sub(r'([a-zA-Z]+)', fun, str1)

print(ret)  # 1233dcxsaa/-1w12=reeds
